package com.xmkj.bearuser.adapter;

import android.content.Context;

import com.common.Entity.MessageListEntity;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.xmkj.bearuser.R;

import java.util.List;

/**
 * Created by chen on 2018/3/28.
 */

public class MessageAdapter extends CommonAdapter<MessageListEntity.ListsEntity> {
    public MessageAdapter(Context context, List<MessageListEntity.ListsEntity> data) {
        super(context, data);
    }

    @Override
    protected void convert(ViewHolder holder, MessageListEntity.ListsEntity item, int position) {
        holder.setText(R.id.tv_title,item.mtitle);
        holder.setText(R.id.tv_content,item.mcontent);
        holder.setText(R.id.tv_time,item.mdate);
        holder.setOnClickListener(R.id.btn_delete,new OnItemChildClickListener());

    }

    @Override
    protected int getItemViewLayoutId(int position, MessageListEntity.ListsEntity item) {
        return R.layout.item_message;
    }
}
